import { createApp } from 'vue'
import App from './App.vue'
import router from './router'

// 引入Element Plus
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'

// 引入Element Plus图标
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

// 引入ECharts
import * as echarts from 'echarts'

// 引入Axios
import axios from 'axios'

const app = createApp(App)

// 注册Element Plus图标
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}

// 全局配置
app.use(ElementPlus)
app.use(router)

// 全局挂载
app.config.globalProperties.$echarts = echarts
app.config.globalProperties.$axios = axios
window.$axios = axios

app.mount('#app')
    